package com.maidou.qiantai.exception.customizationException;

import com.maidou.qiantai.common.constant.HeritageSiteConstant;
import org.springframework.stereotype.Component;

/**
 * @Author maidou
 * @Date 2023/11/28 2:32
 */
@Component
public class DataInputException extends RuntimeException {

    private Integer code = HeritageSiteConstant.ExceptionEum.DATA_INPUT.getCode();;
    private String message = HeritageSiteConstant.ExceptionEum.DATA_INPUT.getMsg();

    public DataInputException(HeritageSiteConstant.ExceptionEum resultEnum) {
        this.code = resultEnum.getCode();
        this.message = resultEnum.getMsg();
    }

    public Integer getCode(){
        return this.code;
    }

    public String getMessage(){
        return this.message;
    }

    public DataInputException(Integer code, String message) {
        this.code = code;
        this.message = message;
    }

    public DataInputException() {
    }

    public DataInputException(String message) {
        this.message = message;
    }

}
